package com.xyy.yueshijia.myadapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
import com.xyy.yueshijia.R;
import com.xyy.yueshijia.bean.MyshouyeBean;

import java.util.List;

import static com.xyy.yueshijia.App.context;

/**
 * Created by Asus on 2017/2/9.
 */

public class MyAdapterSy extends SuperBaseAdapter<MyshouyeBean> {
    private Context mContext;
    public MyAdapterSy(Context context, List<MyshouyeBean> data) {
        super(context, data);
        this.mContext = context;
    }
    @Override
    protected void convert(BaseViewHolder holder, MyshouyeBean item, int position) {
        holder.setText(R.id.homezhutitle,item.getRelation_object_title())
                .setOnClickListener(R.id.homezhutitle,new OnItemChildClickListener());

        String imageURI=item.getRelation_object_image();

        Glide.with(mContext)
                .load(imageURI)
                .placeholder(R.drawable.bg_morentu)
                // .bitmapTransform(transformation) //转换
                .error(R.drawable.bg_morentu)
                .into((ImageView) holder.getView(R.id.imageViewtitle));
    }

    @Override
    protected int getItemViewLayoutId(int position, MyshouyeBean item) {
        return R.layout.homerecycler_item;
    }
}
